<!-- AssignmentAjaxCreateForm -->
<script type="text/javascript">

	function CreateAssignment() {
		// Assumes calling view will wrap the resulting html text in a div titled 'wrapper'
		$('#{{ name }}_working').show();
		$.post("{{ url }}",
			{'{{name}}-title': $('#id_{{name}}-title').val(),
			 '{{name}}-group': $('#id_{{name}}-group').val(),
			 },
			function(data) {
				$('#{{ name }}_working').hide();
				$('#id_{{name}}-title').val('');
				$('#AssignmentList').prepend(data);
			});
	}

</script>

&nbsp;&nbsp;{{ form.title.label }}: {{ form.title|safe }} {{ form.group }}

<button type="button" onclick="javascript:CreateAssignment();" id="{{ name }}_submit">Add</button>

<span id="{{ name }}_working" style="display:none;" >
	<img src="/files/images/working.gif"> adding...
</span>